<style lang="scss" scoped>
	@import "../../utils/base.scss";
    .wait{
        display: block;
        width: 26px;
        height: 26px;
        line-height: 24px;
        text-align: center;
        border: 1px solid #ccc;
        border-radius: 50%;
        font-size: 14px;
        transition: background-color 0.2s ease-in-out;
        border-color: #2d8cf0;
        background-color: #2d8cf0;
    }

    .wait1{
        display: block;
        width: 26px;
        height: 26px;
        line-height: 24px;
        text-align: center;
        border: 1px solid #ccc;
        border-radius: 50%;
        font-size: 14px;
        transition: background-color 0.2s ease-in-out;
        border-color: #2d8cf0;
        background-color: white;
    }
    .ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner > .ivu-steps-icon{
        top: 0px;
    }
</style>

<template>
	<div class="quest_content" style="overflow-y:auto;height:100%;width:100%;">
		<template id="baseinfo">
			<div class="qheader" :style="{borderBottom: ifedit ? '0px solid rgb(210,210,210)' : '1px solid rgb(210,210,210)',}">
				<p>基本信息</p>
			</div>
			<div class="gcontent">
				<Form ref="baseinfo" :model="applyinfo" :rules="projectInfoValidate" :label-width="labelWidth" label-position="left"
				 class="form form_left">
					<Row v-if="reqId != null && reqId != ''">
						<Col span="8">
						<FormItem label="工单ID：">
							<Input v-model="reqId" :readonly="readonly" />
						</FormItem>
						</Col>
					</Row>
					<Row>
						<Col span="8">
						<FormItem label="姓名：">
							<Input v-model="base.userName" :readonly="readonly" />
						</FormItem>
						</Col>
						<Col span="8" class="col_left">
						<FormItem label="邮箱：">
							<Input v-model="base.mail" :readonly="readonly" />
						</FormItem>
						</Col>
					</Row>
					<Row>
						<Col span="8">
						<FormItem label="电话：">
							<Input v-model="base.phone" :readonly="readonly" />
						</FormItem>
						</Col>
						<Col span="8" class="col_left">
						<FormItem label="部门：">
							<Input v-model="base.department" :readonly="readonly" />
						</FormItem>
						</Col>
					</Row>

					<Row>
						<Col span="8">
						<FormItem label="工单标题：" prop="reqDes">
							<Input v-model="applyinfo.reqDes" placeholder="XXX资源池+XXX系统+标题描述" :readonly="ifedit" />
						</FormItem>
						</Col>
						<Col span="8" class="col_left">
						<FormItem label="销户申请日期：" prop="startTime">
							<DatePicker :options="disabledDate" v-model="applyinfo.startTime" style="width: 100%;" type="date" :disabled="ifedit"
							 placeholder="请选择日期"></DatePicker>
						</FormItem>
						</Col>
					</Row>
					<Row>
						<Col span="8">
						<FormItem label="所属租户：" prop="roleId">
							<Input v-if="ifedit" v-model="base.roleName" :readonly="readonly" />
							<Select v-else v-model="applyinfo.roleId" @on-change="checkRole" filterable :disabled="ifedit">
								<Option v-for="item in roleList" :value="item.id" :key="item.id">{{item.tenant_name}}</Option>
							</Select>
						</FormItem>
						</Col>
						<Col span="8" class="col_left">
						<FormItem label="所属项目：" prop="projectId">
							<Input v-if="ifedit" v-model="base.projectName" :readonly="readonly" />
							<Select v-else :label-in-value="true" v-model="applyinfo.projectId" filterable @on-change="checkProject" :disabled="ifedit" :transfer="true">
								<Option v-for="item in projectList" :value="item.id" :key="item.id">{{item.project}}</Option>
							</Select>
						</FormItem>
						</Col>
					</Row>
					<Row v-if="!ifedit">
						<Col span="8">
						<FormItem label="4A主账号：">
							<Input v-model= "search_param" search placeholder="请输入4A主账号" @on-search="searchAccount(search_param)"/>
						</FormItem>
						</Col>
					</Row>
				</Form>
			</div>
			<div class="qheader" :style="{borderBottom: ifedit ? '0px solid rgb(210,210,210)' : '1px solid rgb(210,210,210)',}">
				<p>销户信息</p>
			</div>
			<div class="gcontent">
				<Form ref="accountCancel" :model="applyinfo" :rules="projectInfoValidate" :label-width="20" label-position="left"
				 class="form form_left">
					<p style=" margin:5px;" v-if="ifedit?(seversList.length>0):true">主机账号：</p>
					<Row v-if="ifedit?(seversList.length>0):true">
						<Col span="23" style="width:96.666667%">
						<FormItem>
							<Table v-if="ifedit" border ref="selection_servers" @on-selection-change="select_servers" :columns="getSerColumns"
							 :data="seversList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
							<Table v-else border ref="selection_servers" @on-selection-change="select_servers" :columns="getSerColumns" :data="seversList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
						</FormItem>
						</Col>
					</Row>
					<p style="margin:5px" v-if="ifedit?(dbsList.length>0):true">数据库账号：</p>
					<Row v-if="ifedit?(dbsList.length>0):true">
						<Col span="23" style="width:96.666667%">
						<FormItem>
							<Table v-if="ifedit" border ref="selection_dbs" @on-selection-change="select_dbs" :columns="getDbColumns" :data="dbsList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
							<Table v-else border ref="selection_dbs" @on-selection-change="select_dbs" :columns="getDbColumns" :data="dbsList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
						</FormItem>
						</Col>
					</Row>
					<p style="margin:5px" v-if="ifedit?(hadoopsList.length>0):true">Hadoop账号：</p>
					<Row v-if="ifedit?(hadoopsList.length>0):true">
						<Col span="23" style="width:96.666667%">
						<FormItem>
							<Table v-if="ifedit" border ref="selection_hadoop" @on-selection-change="select_hadoop" :columns="getHadColumns"
							 :data="hadoopsList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
							<Table v-else border ref="selection_hadoop" @on-selection-change="select_hadoop" :columns="getHadColumns" :data="hadoopsList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
						</FormItem>
						</Col>
					</Row>
					<p style="margin:5px" v-if="ifedit?(hftpsList.length>0):true">UAP账号：</p>
					<Row v-if="ifedit?(hftpsList.length>0):true">
						<Col span="23" style="width:96.666667%">
						<FormItem>
							<Table v-if="ifedit" border ref="selection_uap" @on-selection-change="select_uap" :columns="getUapColumns" :data="hftpsList">
								<template slot-scope=" { row, index }" slot="des">
									<p>{{getUapDes(row)}}</p>
								</template>
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
							<Table v-else border ref="selection_uap" @on-selection-change="select_uap" :columns="getUapColumns" :data="hftpsList">
								<template slot-scope=" { row, index }" slot="des">
									<p>{{getUapDes(row)}}</p>
								</template>
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
						</FormItem>
						</Col>
					</Row>
					<p style="margin:5px" v-if="ifedit?(paasList.length>0):true">PaaS门户账号：</p>
					<Row v-if="ifedit?(paasList.length>0):true">
						<Col span="23" style="width:96.666667%">
						<FormItem>
							<Table v-if="ifedit" border ref="selection_paas" @on-selection-change="select_paas" :columns="getPaasColumns"
							 :data="paasList">
								<template slot-scope=" { row, index }" slot="paasType">
									<p v-if="row.paasType=='paas_huawei'">华为PaaS</p>
									<p v-else>亚信PaaS</p>
								</template>
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
							<Table v-else border ref="selection_paas" @on-selection-change="select_paas" :columns="getPaasColumns" :data="paasList">
								<template slot-scope=" { row, index }" slot="paasType">
									<p v-if="row.paasType=='paas_huawei'">华为PaaS</p>
									<p v-else>亚信PaaS</p>
								</template>
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
						</FormItem>
						</Col>
					</Row>
					<p style="margin:5px" v-if="ifedit?(dacpList.length>0):true">DACP账号：</p>
					<Row v-if="ifedit?(dacpList.length>0):true">
						<Col span="23" style="width:96.666667%">
						<FormItem>
							<Table v-if="ifedit" border ref="selection_dacp" @on-selection-change="select_dacp" :columns="getDacpColumns"
							 :data="dacpList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
							<Table v-else border ref="selection_dacp" @on-selection-change="select_dacp" :columns="getDacpColumns" :data="dacpList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
						</FormItem>
						</Col>
					</Row>
					<p style="margin:5px" v-if="ifedit?(elseAuthesList.length>0):true">其他权限内容：</p>
					<Row v-if="ifedit?(elseAuthesList.length>0):true">
						<Col span="23" style="width:96.666667%">
						<FormItem>
							<Table v-if="ifedit" border ref="selection_elseauthe" @on-selection-change="select_elseauthe" :columns="getElseColumns"
							 :data="elseAuthesList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
							<Table v-else border ref="selection_elseauthe" @on-selection-change="select_elseauthe" :columns="getElseColumns" :data="elseAuthesList">
								<template slot-scope=" { row, index }" slot="deadline">
									<p>{{formatDate(row.deadline)}}</p>
								</template>
							</Table>
						</FormItem>
						</Col>
					</Row>
				</Form>

			</div>
		</template>

		<!-- 附件 -->
		<template>
			<div class="qheader" :style="{borderBottom: '1px solid rgb(210,210,210)',}">
				<p>附件</p>
			</div>
			<component ref="file" :is="'file'" :ifedit="ifedit" :filesList="filesList" v-model="applyinfo.files"></component>
		</template>

	</div>
</template>

<script>
	import ajax from "../../ajax_util"
	import Axios from 'axios'
	import file from './settledin/file'

	export default {
		name: "apply",
		components: {
			file
		},

		data() {

			return {
				ser_columns: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号类型',
						key: 'accountAttr'
					},
					{
						title: '设备IP地址',
						key: 'ip'
					},
					{
						title: '设备名称',
						key: 'sname'
					},
					{
						title: '组读和执行权限目录',
						key: 'rxPath'
					},
					{
						title: '组需写权限目录',
						key: 'wpath'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					}
				],
				db_columns :[
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号类型',
						key: 'accountAttr'
					},
					{
						title: '设备IP地址',
						key: 'ip'
					},
					{
						title: '资源池/设备名称',
						key: 'sname'
					},
					{
						title: '数据库类型',
						key: 'dbType'
					},
					{
						title: '权限',
						key: 'auth'
					},
					{
						title: '库名',
						key: 'dbName'
					},
					{
						title: '表名',
						key: 'tableName'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					}
				],
				had_columns: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: 'keytab描述',
						key: 'keytab'
					},
					{
						title: 'Hadoop组件',
						key: 'hadoopAccountType'
					},
					{
						title: '具体权限描述',
						key: 'auth'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				uap_columns: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '场景说明',
						slot: 'des'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				paas_columns: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号类型',
						slot: 'paasType'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				dacp_columns: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号类型',
						key: 'dacpAccoutType'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				else_columns: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '权限说明',
						key: 'des'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				columns: [
					{
						type: 'selection',
						width: 60,
						align: 'center'
					},
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '账号类型',
						key: 'accountAttr'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				columns_show: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '账号类型',
						key: 'accountAttr'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				columns2: [
					{
						type: 'selection',
						width: 60,
						align: 'center'
					},
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				columns2_show: [
					{
						title: '姓名',
						key: 'peopleName'
					},
					{
						title: '从账号',
						key: 'subAccount'
					},
					{
						title: '4A账号',
						key: 'fourA'
					},
					{
						title: '所属系统',
						key: 'sysName'
					},
					{
						title: '账号到期日期',
						key: 'deadline',
						slot: 'deadline'
					},
				],
				labelWidth: 140,
				readonly: true, //是否只读
				disabledDate: {
					disabledDate(date) {
						return date && date.valueOf() < Date.now() - 24 * 60 * 60 * 1000 || date.valueOf() > Date.now() + 365 * 24 * 60 *
							60 * 1000;
					}
				},
				//ifedit: this.isedit,
				applyinfo: {
					reqDes: "", // 工单标题
					userName: "",

					phone: "",
					mail: "",
					startTime: "",
					deadline: "",

					roleId: "",
					projectId: "",
					roleName: "",
					projectName: "",

					files: []
				},
				roleList: [],
				projectList: [],

				seversList: [],
				dbsList: [],
				hadoopsList: [],
				hftpsList: [],
				paasList: [],
				dacpList: [],
				elseAuthesList: [],

				allAccounts:{
					severs:[],
					dbs:[],
					hadoops:[],
					hftps:[],
					paas:[],
					dacps:[],
					elseAuthes:[]
				},

				cancelAccountIds: [],
				people: [{
					severs: [],
					dbs: [],
					hadoops: [],
					hftps: [],
					paas: [],
					dacps: [],
					elseAuthes: [],
				}],
				editproject: {},
				editcancelAccounts: {},
				editcancelAccountIds: [],
				getApplyInfocancelAccountIds: [],
				base: {
					user_name: "",
					phone: "",
					mail: "",
					id_card: "",
					department: "",
					roleName: "",
					projectName: "",
				},

				projectInfoValidate: {
					reqDes: [{
							required: true,
							type: 'string',
							message: '请填写工单主题',
							trigger: 'blur'
						},
						{
							type: 'string',
							max: 50,
							message: '最多填写50个字符',
							trigger: 'blur'
						}
					],
					startTime: [{
						required: true,
						type: 'date',
						message: '请选择销户日期',
						trigger: 'change'
					}, ],
					roleId: [{
						required: true,
						type: 'number',
						message: '请选择所属',
						trigger: 'change'
					}],
					projectId: [{
						required: true,
						type: 'number',
						message: '请选择所属项目',
						trigger: 'change'
					}],
				},
				search_param:""
			}
		},
		computed:{
			getSerColumns(){
				if(!this.ifedit){
				    this.ser_columns.unshift(
						{
							type: 'selection',
							width: 60,
							align: 'center'
						},
				    );
				}
				return this.ser_columns;
			},
			getDbColumns(){
				if(!this.ifedit){
				    this.db_columns.unshift(
						{
							type: 'selection',
							width: 60,
							align: 'center'
						},
				    );
				}
				return this.db_columns;
			},
			getHadColumns(){
				if(!this.ifedit){
				    this.had_columns.unshift(
						{
							type: 'selection',
							width: 60,
							align: 'center'
						},
				    );
				}
				return this.had_columns;
			},
			getUapColumns(){
				if(!this.ifedit){
				    this.uap_columns.unshift(
						{
							type: 'selection',
							width: 60,
							align: 'center'
						},
				    );
				}
				return this.uap_columns;
			},
			getPaasColumns(){
				if(!this.ifedit){
				    this.paas_columns.unshift(
						{
							type: 'selection',
							width: 60,
							align: 'center'
						},
				    );
				}
				return this.paas_columns;
			},
			getDacpColumns(){
				if(!this.ifedit){
				    this.dacp_columns.unshift(
						{
							type: 'selection',
							width: 60,
							align: 'center'
						},
				    );
				}
				return this.dacp_columns;
			},
			getElseColumns(){
				if(!this.ifedit){
				    this.else_columns.unshift(
						{
							type: 'selection',
							width: 60,
							align: 'center'
						},
				    );
				}
				return this.else_columns;
			},
		},
		created: function() {

		},

		mounted: function() {
			// console.log("this.reqId,this.draftsId---------->", this.reqId, this.draftsId)
			// console.log('this.$store.state.tabs', this.$store.state.tabs)
			this.setPageInfo()
		},
		methods: {
			exportAccountCancel(){
				console.log("!!!!!!!!!!!");
				//列标题，逗号隔开
				let str = `姓名,主账号,从账号,所属系统,账号类型,账号属性,ip信息,组读和执行权限目录,组需写权限目录\n`;
				//增加\t为了不让表格显示科学计数法或者其他格式
				for (let j = 0; j < this.seversList.length; j++) {
					//str+=`${jsonData[i][item] + '\t'},`;
					str += this.seversList[j].peopleName + "," + this.seversList[j].fourA + "," + this.seversList[j].subAccount + "," + this.seversList[j].sysName + "," +
						"主机账号" + "," + this.seversList[j].accountAttr + "," + this.seversList[j].ip + ","
						+ this.seversList[j].rxPath + "," + this.seversList[j].wpath + '\n';
				}

				for (let j = 0; j < this.dbsList.length; j++) {
					//str+=`${jsonData[i][item] + '\t'},`;
					str += this.dbsList[j].peopleName + "," + this.dbsList[j].fourA + "," + this.dbsList[j].subAccount + "," + this.dbsList[j].sysName + "," +
						"数据库账号" + "," + this.dbsList[j].accountAttr + "," + this.dbsList[j].ip +
						"," + "" + "," + "" + '\n';
				}

				for (let j = 0; j < this.hadoopsList.length; j++) {
					//str+=`${jsonData[i][item] + '\t'},`;
					str += this.hadoopsList[j].peopleName + "," + this.hadoopsList[j].fourA + "," + this.hadoopsList[j].subAccount + "," + this.hadoopsList[j].sysName + "," +
						"Hadoop账号" + "," + "" + "," + "" + "," + "" + "," + "" +'\n';
				}

				for (let j = 0; j < this.hftpsList.length; j++) {
					//str+=`${jsonData[i][item] + '\t'},`;
					str += this.hftpsList[j].peopleName + "," + this.hftpsList[j].fourA + "," + this.hftpsList[j].subAccount + "," + this.hftpsList[j].sysName + "," +
						"UAP账号" + "," + "" + "," + "" + "," + "" + "," + "" + '\n';
				}

				for (let j = 0; j < this.paasList.length; j++) {
					//str+=`${jsonData[i][item] + '\t'},`;
					str += this.paasList[j].peopleName + "," + this.paasList[j].fourA + "," + this.paasList[j].subAccount + "," + this.paasList[j].sysName + "," +
						"PaaS账号" + "," + "" + "," + "" + "," + "" + "," + "" + '\n';
				}

				for (let j = 0; j < this.dacpList.length; j++) {
					//str+=`${jsonData[i][item] + '\t'},`;
					str += this.dacpList[j].peopleName + "," + this.dacpList[j].fourA + "," + this.dacpList[j].subAccount + "," + this.dacpList[j].sysName + "," +
						"DACP账号" + "," + "" + "," + "" + "," + "" + "," + "" + '\n';
				}

				for (let j = 0; j < this.elseAuthesList.length; j++) {
					//str+=`${jsonData[i][item] + '\t'},`;
					str += this.elseAuthesList[j].peopleName + "," + this.elseAuthesList[j].fourA + "," + this.elseAuthesList[j].subAccount + "," + this.elseAuthesList[j].sysName + "," +
						"其他账号" + "," + "" + "," + "" + "," + "" + ","  + "" + '\n';
				}

				//encodeURIComponent解决中文乱码， \ufeff是 ""
				let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str);
				//通过创建a标签实现
				let link = document.createElement("a");
				link.href = uri;
				//对下载的文件命名
				link.download = "工单" + this.reqId + "_销户信息.csv";
				document.body.appendChild(link);
				link.click();
				document.body.removeChild(link);
			},
			searchAccount(fourA){
				console.log("----selection------",this.people[0]);
				this.seversList = this.allAccounts.severs.filter(item => item.fourA.indexOf(fourA) > -1);
				this.dbsList = this.allAccounts.dbs.filter(item => item.fourA.indexOf(fourA) > -1);
				this.hadoopsList = this.allAccounts.hadoops.filter(item => item.fourA.indexOf(fourA) > -1);
				this.hftpsList = this.allAccounts.hftps.filter(item => item.fourA.indexOf(fourA) > -1);
				this.paasList = this.allAccounts.paas.filter(item => item.fourA.indexOf(fourA) > -1);
				this.dacpList = this.allAccounts.dacps.filter(item => item.fourA.indexOf(fourA) > -1);
				this.elseAuthesList = this.allAccounts.elseAuthes.filter(item => item.fourA.indexOf(fourA) > -1);
				this.setSelection();
			},
			setSelection(){
				var cancelAccounts = this.people[0];

				this.seversList.forEach(item => {
					item._checked = false
					cancelAccounts['severs'].forEach(key => {
						if (item.id == key.id) {
							item._checked = true
						}
					})
				})

				this.dbsList.forEach(item => {
					item._checked = false
					cancelAccounts['dbs'].forEach(key => {
						if (item.id == key.id) {
							item._checked = true
						}
					})
				})

				this.hadoopsList.forEach(item => {
					item._checked = false
					cancelAccounts['hadoops'].forEach(key => {
						if (item.id == key.id) {
							item._checked = true
						}
					})
				})

				this.hftpsList.forEach(item => {
					item._checked = false
					cancelAccounts['hftps'].forEach(key => {
						if (item.id == key.id) {
							item._checked = true
						}
					})
				})

				this.paasList.forEach(item => {
					item._checked = false
					cancelAccounts['paas'].forEach(key => {
						if (item.id == key.id) {
							item._checked = true
						}
					})
				})

				this.dacpList.forEach(item => {
					item._checked = false
					cancelAccounts['dacps'].forEach(key => {
						if (item.id == key.id) {
							item._checked = true
						}
					})
				})

				this.elseAuthesList.forEach(item => {
					item._checked = false
					cancelAccounts['elseAuthes'].forEach(key => {
						if (item.id == key.id) {
							item._checked = true
						}
					})
				})
			},
			select_servers(selection) {
				console.log('selection', selection)
				if(this.search_param != undefined && this.search_param != null && this.search_param != ""){
					this.seversList.forEach(item=>{
						for(var i=0; i<this.people[0].severs.length; i++){
							if(item.id == this.people[0].severs[i].id){
								this.people[0].severs.splice(i,1);
								break;
							}
						}
					})

					selection.forEach(item=>{
						var noRepeat = true;
						this.people[0].severs.forEach(p=>{
							if(p.id == item.id){
								noRepeat = false
							}
						})
						if(noRepeat){
							this.people[0].severs.push(item);
						}
					})
				}else{
					this.people[0].severs = selection
				}

				console.log('people[0]', this.people[0])
			},
			select_dbs(selection) {
				if(this.search_param != undefined && this.search_param != null && this.search_param != ""){
					this.dbsList.forEach(item=>{
						for(var i=0; i<this.people[0].dbs.length; i++){
							if(item.id == this.people[0].dbs[i].id){
								this.people[0].dbs.splice(i,1);
								break;
							}
						}
					})

					selection.forEach(item=>{
						var noRepeat = true;
						this.people[0].dbs.forEach(p=>{
							if(p.id == item.id){
								noRepeat = false
							}
						})
						if(noRepeat){
							this.people[0].dbs.push(item);
						}
					})
				}else{
					this.people[0].dbs = selection
				}
			},
			select_hadoop(selection) {
				if(this.search_param != undefined && this.search_param != null && this.search_param != ""){
					this.hadoopsList.forEach(item=>{
						for(var i=0; i<this.people[0].hadoops.length; i++){
							if(item.id == this.people[0].hadoops[i].id){
								this.people[0].hadoops.splice(i,1);
								break;
							}
						}
					})

					selection.forEach(item=>{
						var noRepeat = true;
						this.people[0].hadoops.forEach(p=>{
							if(p.id == item.id){
								noRepeat = false
							}
						})
						if(noRepeat){
							this.people[0].hadoops.push(item);
						}
					})
				}else{
					this.people[0].hadoops = selection
				}
			},
			select_uap(selection) {
				if(this.search_param != undefined && this.search_param != null && this.search_param != ""){
					this.hftpsList.forEach(item=>{
						for(var i=0; i<this.people[0].hftps.length; i++){
							if(item.id == this.people[0].hftps[i].id){
								this.people[0].hftps.splice(i,1);
								break;
							}
						}
					})

					selection.forEach(item=>{
						var noRepeat = true;
						this.people[0].hftps.forEach(p=>{
							if(p.id == item.id){
								noRepeat = false
							}
						})
						if(noRepeat){
							this.people[0].hftps.push(item);
						}
					})
				}else{
					this.people[0].hftps = selection
				}
			},
			select_paas(selection) {
				if(this.search_param != undefined && this.search_param != null && this.search_param != ""){
					this.paasList.forEach(item=>{
						for(var i=0; i<this.people[0].paas.length; i++){
							if(item.id == this.people[0].paas[i].id){
								this.people[0].paas.splice(i,1);
								break;
							}
						}
					})

					selection.forEach(item=>{
						var noRepeat = true;
						this.people[0].paas.forEach(p=>{
							if(p.id == item.id){
								noRepeat = false
							}
						})
						if(noRepeat){
							this.people[0].paas.push(item);
						}
					})
				}else{
					this.people[0].paas = selection
				}
			},
			select_dacp(selection) {
				if(this.search_param != undefined && this.search_param != null && this.search_param != ""){
					this.dacpList.forEach(item=>{
						for(var i=0; i<this.people[0].dacps.length; i++){
							if(item.id == this.people[0].dacps[i].id){
								this.people[0].dacps.splice(i,1);
								break;
							}
						}
					})

					selection.forEach(item=>{
						var noRepeat = true;
						this.people[0].dacps.forEach(p=>{
							if(p.id == item.id){
								noRepeat = false
							}
						})
						if(noRepeat){
							this.people[0].dacps.push(item);
						}
					})
				}else{
					this.people[0].dacps = selection
				}
			},
			select_elseauthe(selection) {
				if(this.search_param != undefined && this.search_param != null && this.search_param != ""){
					this.elseAuthesList .forEach(item=>{
						for(var i=0; i<this.people[0].elseAuthes.length; i++){
							if(item.id == this.people[0].elseAuthes[i].id){
								this.people[0].elseAuthes.splice(i,1);
								break;
							}
						}
					})

					selection.forEach(item=>{
						var noRepeat = true;
						this.people[0].elseAuthes.forEach(p=>{
							if(p.id == item.id){
								noRepeat = false
							}
						})
						if(noRepeat){
							this.people[0].elseAuthes.push(item);
						}
					})
				}else{
					this.people[0].elseAuthes = selection
				}
			},
			//获取租户角色
			getRoleLis(userId) {
				if (userId != undefined && userId != null && userId != '') {
					var url = this.CONFIG.url_know + "/tenantByUserId/" + userId
					var that = this;
					ajax.get({
						url: url,
						that: that,
						params: null,
						success: function(data) {
							that.roleList = data
							// that.roleList.some(item => {
							// 	if (that.applyinfo.roleId == item.id) {
							// 		that.base.roleName = item.tenant_name
							// 		that.applyinfo.roleName = item.tenant_name
							// 		return true
							// 	}
							// })

							if (that.applyinfo.roleId != null && that.applyinfo.roleId != undefined && that.applyinfo.roleId != "") {
								that.checkRole(that.applyinfo.roleId);
							}
						}
					})
				}
			},
			getRoleName(roleId){
				if (roleId != undefined && roleId != null && roleId != '') {
					var url = this.CONFIG.url_know + "/tenant/" + roleId
					var that = this;
					ajax.get({
						url: url,
						that: that,
						success: function(data) {
							that.base.roleName = data.tenant_name
							that.applyinfo.roleName = data.tenant_name


							// if (that.applyinfo.roleId != null && that.applyinfo.roleId != undefined && that.applyinfo.roleId != "") {
							// 	that.checkRole(that.applyinfo.roleId);
							// }
						}
					})
				}
			},
			setPageInfo() {
				if (this.reqId == null && this.draftsId == null) {
					this.getRoleLis(this.$store.state.user.id)
					this.getUserInfo()
					this.applyinfo.startTime = new Date()
				} else if (this.reqId != null) {
					console.log("获取表单详情---------->");
					this.getApplyInfo(); //获取表单详情
					if(!this.ifedit){
						this.setblack(this.editproject, this.editcancelAccounts)
					}
				} else if (this.draftsId != null) {
					console.log("获取草稿---------->")
					this.getRoleLis(this.$store.state.user.id)
					this.getDrafts();
				}
			},
			checkRole(roleId) {
				if (roleId != undefined && roleId != null && roleId != "") {
					this.people = [{
						severs: [],
						dbs: [],
						hadoops: [],
						hftps: [],
						paas: [],
						dacps: [],
						elseAuthes: [],
					}]
					this.roleList.some(item => {
						if (roleId == item.id) {
							console.log("===item========", item);
							this.applyinfo.roleId = roleId
							this.base.roleName = item.tenant_name
							this.applyinfo.roleName = item.tenant_name
							this.projectList = item.projects
							return true
						}
					})

					if (this.applyinfo.projectId != "") {
						var t = this.projectList.find(e => e.id == this.applyinfo.projectId)
						if (t != undefined) {
							this.applyinfo.projectName = t.project
						}
					}

					// var url = this.CONFIG.url_know + "/getProjects/" + roleId
					// var that = this;
					// ajax.get({
					//   url: url,
					//   that: that,
					//   params: null,
					//   success: function(data) {
					//     that.projectList = data
					//     if (that.applyinfo.projectId != "") {
					//       var t = data.find(e => e.id == that.applyinfo.projectId)
					//       if (t != undefined) {
					//         that.applyinfo.projectName = t.project
					//       }
					//     }
					//   }
					// })
				}
			},

			checkProject(project) {
				console.log('projectId------>', project)
				if (project != undefined && project.value != undefined && project.value != null && project.value != '') {
					this.applyinfo.projectName = project.label
					var temp = {
						projectId: project.value
					}
					var url = this.CONFIG.progress_url + '/account-withdraw/accounts'
					var that = this;
					ajax.get({
						url: url,
						that: that,
						params: temp,
						success: function(data) {
							console.log('checkProject', data)
							that.seversList = data['severs']
							that.dbsList = data['dbs']
							that.hadoopsList = data['hadoops']
							that.hftpsList = data['hftps']
							that.paasList = data['paas']
							that.dacpList = data['dacps']
							that.elseAuthesList = data['elseAuthes']

							that.allAccounts.severs = data['severs']
							that.allAccounts.dbs = data['dbs']
							that.allAccounts.hadoops = data['hadoops']
							that.allAccounts.hftps = data['hftps']
							that.allAccounts.paas = data['paas']
							that.allAccounts.dacps = data['dacps']
							that.allAccounts.elseAuthes = data['elseAuthes']
						}
					})
				}

			},

			getUserInfo() {
				var temp = this.$store.state.user
				console.log('getUserInfo', temp)
				this.base.userName = temp.user_name
				this.base.phone = temp.phone
				this.base.mail = temp.email
				this.base.department = temp.department
				this.base.id_card = temp.id_card
				this.applyinfo.userId = temp.id
			},

			setInfo(userId, roleId, projectId) {
				var that = this;
				var user_url = that.CONFIG.url_know + '/user/' + userId
				ajax.get({
					url: user_url,
					that: that,
					params: null,
					success: function(data) {
						console.log('user', data)
						that.base.userName = data.user_name
						that.base.phone = data.phone
						that.base.mail = data.email
						that.base.department = that.processInfo.dptName
					}
				})
				this.checkRole(roleId)

				var project_url = that.CONFIG.url_know + '/projectById/' + projectId
				ajax.get({
					url: project_url,
					that: that,
					params: null,
					success: function(data) {
						that.base.projectName = data.project
					}
				})

			},

			setAccount(cancelAccounts) {
				console.log('==============cancelAccounts', cancelAccounts)
				this.seversList = cancelAccounts.severs
				this.dbsList = cancelAccounts.dbs
				this.hadoopsList = cancelAccounts.hadoops
				this.hftpsList = cancelAccounts.hftps
				this.paasList = cancelAccounts.paas
				this.dacpList = cancelAccounts.dacps
				this.elseAuthesList = cancelAccounts.elseAuthes
			},
			setId(cancelAccounts) {
				var temp = []
				cancelAccounts.severs.forEach(item => {
					temp.push(item.id)
				})
				cancelAccounts.dbs.forEach(item => {
					temp.push(item.id)
				})
				cancelAccounts.hadoops.forEach(item => {
					temp.push(item.id)
				})
				cancelAccounts.hftps.forEach(item => {
					temp.push(item.id)
				})
				cancelAccounts.paas.forEach(item => {
					temp.push(item.id)
				})
				cancelAccounts.dacps.forEach(item => {
					temp.push(item.id)
				})
				cancelAccounts.elseAuthes.forEach(item => {
					temp.push(item.id)
				})
				return temp
			},
			getApplyInfo() {
				var data = this.processInfo
				console.log("getApplyInfo----111->", data.content)

				this.applyinfo = data.content
				if (data.files != undefined && data.files != null) {
					this.applyinfo.files = data.files
				}
				if(this.ifedit){
					//this.networkInfo.startTime = this.formatDate(data.content.startTime)
					this.applyinfo.startTime = this.formatDate(data.content.startTime)
					this.applyinfo.deadline = this.formatDate(data.content.deadline)
				}

				if(data.content.userId == this.$store.state.user.id){
					this.getRoleLis(data.content.userId)
				}
				this.getRoleName(data.content.roleId);
				this.setInfo(data.content.userId, data.content.roleId, data.content.projectId)
				if(data.content.rspInfo != undefined && data.content.rspInfo != null){
					if(data.content.rspInfo.cancelAccounts != undefined && data.content.rspInfo.cancelAccounts != null){
						this.setAccount(data.content.rspInfo.cancelAccounts)
						this.editcancelAccountIds = this.setId(data.content.rspInfo.cancelAccounts)
						this.editcancelAccounts = data.content.rspInfo.cancelAccounts
					}
				}

				this.editproject = {
					label: data.content.projectName,
					value: data.content.projectId
				}
			},

			setblack(project, cancelAccounts) {
				if (project != undefined && project.value != undefined && project.value != null && project.value != '') {
					this.applyinfo.projectName = project.label
					var temp = {
						projectId: project.value
					}
					var url = this.CONFIG.progress_url + '/account-withdraw/accounts'
					var that = this;
					var seversList = []
					var dbsList = []
					var hadoopsList = []
					var hftpsList = []
					var paasList = []
					var dacpList = []
					var elseAuthesList = []
					ajax.get({
						url: url,
						that: that,
						params: temp,
						success: function(data) {
							console.log('setblack', data)
							that.allAccounts.severs = data['severs']
							that.allAccounts.dbs = data['dbs']
							that.allAccounts.hadoops = data['hadoops']
							that.allAccounts.hftps = data['hftps']
							that.allAccounts.paas = data['paas']
							that.allAccounts.dacps = data['dacps']
							that.allAccounts.elseAuthes = data['elseAuthes']

							seversList = data['severs']
							dbsList = data['dbs']
							hadoopsList = data['hadoops']
							hftpsList = data['hftps']
							paasList = data['paas']
							dacpList = data['dacps']
							elseAuthesList = data['elseAuthes']

							var temp = {}
							var select_seversList = []
							that.seversList = []
							if(seversList != undefined && seversList != null && seversList.length>0){
								seversList.forEach(item => {
									temp = item
									cancelAccounts['severs'].forEach(ID => {
										if (item.id == ID.id) {
											temp._checked = true
											select_seversList.push(temp)
										}
									})
									that.seversList.push(temp)
								})
							}
							that.select_servers(select_seversList)

							var select_dbsList = []
							that.dbsList = []
							if(dbsList != undefined && dbsList != null && dbsList.length>0){
								dbsList.forEach(item => {
									temp = item
									cancelAccounts['dbs'].forEach(ID => {
										if (item.id == ID.id) {
											temp._checked = true
											select_dbsList.push(temp)
										}
									})
									that.dbsList.push(temp)
								})
							}
							that.select_dbs(select_dbsList)

							var select_hadoopsList = []
							that.hadoopsList = []
							if(hadoopsList != undefined && hadoopsList != null && hadoopsList.length>0){
								hadoopsList.forEach(item => {
									temp = item
									cancelAccounts['hadoops'].forEach(ID => {
										if (item.id == ID.id) {
											temp._checked = true
											select_hadoopsList.push(temp)
										}
									})
									that.hadoopsList.push(temp)
								})
							}
							that.select_hadoop(select_hadoopsList)

							var select_hftpsList = []
							that.hftpsList = []
							if(hftpsList != undefined && hftpsList != null && hftpsList.length>0){
								hftpsList.forEach(item => {
									temp = item
									cancelAccounts['hftps'].forEach(ID => {
										if (item.id == ID.id) {
											temp._checked = true
											select_hftpsList.push(temp)
										}
									})
									that.hftpsList.push(temp)
								})
							}
							that.select_uap(select_hftpsList)

							var select_paasList = []
							that.paasList = []
							if(paasList != undefined && paasList != null && paasList.length>0){
								paasList.forEach(item => {
									temp = item
									cancelAccounts['paas'].forEach(ID => {
										if (item.id == ID.id) {
											temp._checked = true
											select_paasList.push(temp)
										}
									})
									that.paasList.push(temp)
								})
							}
							that.select_paas(select_paasList)

							var select_dacpList = []
							that.dacpList = []
							if(dacpList != undefined && dacpList != null && dacpList.length>0){
								dacpList.forEach(item => {
									temp = item
									cancelAccounts['dacps'].forEach(ID => {
										if (item.id == ID.id) {
											temp._checked = true
											select_dacpList.push(temp)
										}
									})
									that.dacpList.push(temp)
								})
							}
							that.select_dacp(select_dacpList)

							var select_elseAuthesList = []
							that.elseAuthesList = []
							if(elseAuthesList != undefined && elseAuthesList != null && elseAuthesList.length>0){
								elseAuthesList.forEach(item => {
									temp = item
									cancelAccounts['elseAuthes'].forEach(ID => {
										if (item.id == ID.id) {
											temp._checked = true
											select_elseAuthesList.push(temp)
										}
									})
									that.elseAuthesList.push(temp)
								})
							}
							that.select_elseauthe(select_elseAuthesList)

							console.log("======222222222===",that.people[0]);
						}
					})
				}
			},
			setdrafts(project, cancelAccountIds) {
				if (project != undefined && project.value != undefined && project.value != null && project.value != '') {
					this.applyinfo.projectName = project.label
					var temp = {
						projectId: project.value
					}
					var url = this.CONFIG.progress_url + '/account-withdraw/accounts'
					var that = this;
					var seversList = []
					var dbsList = []
					var hadoopsList = []
					var hftpsList = []
					var paasList = []
					var dacpList = []
					var elseAuthesList = []
					ajax.get({
						url: url,
						that: that,
						params: temp,
						success: function(data) {
							console.log('setdrafts', data)
							that.allAccounts.severs = data['severs']
							that.allAccounts.dbs = data['dbs']
							that.allAccounts.hadoops = data['hadoops']
							that.allAccounts.hftps = data['hftps']
							that.allAccounts.paas = data['paas']
							that.allAccounts.dacps = data['dacps']
							that.allAccounts.elseAuthes = data['elseAuthes']

							seversList = data['severs']
							dbsList = data['dbs']
							hadoopsList = data['hadoops']
							hftpsList = data['hftps']
							paasList = data['paas']
							dacpList = data['dacps']
							elseAuthesList = data['elseAuthes']

							var temp = {}
							var select_seversList = []
							if(seversList != undefined && seversList != null && seversList.length>0){
								seversList.forEach(item => {
									temp = item
									cancelAccountIds.forEach(ID => {
										if (item.id == ID) {
											temp._checked = true
											select_seversList.push(temp)
										}
									})
									that.seversList.push(temp)
								})
							}
							that.select_servers(select_seversList)


							var select_dbsList = []
							if(dbsList != undefined && dbsList != null && dbsList.length>0){
								dbsList.forEach(item => {
									temp = item
									cancelAccountIds.forEach(ID => {
										if (item.id == ID) {
											temp._checked = true
											select_dbsList.push(temp)
										}
									})
									that.dbsList.push(temp)
								})
							}
							that.select_dbs(select_dbsList)

							var select_hadoopsList = []
							if(hadoopsList != undefined && hadoopsList != null && hadoopsList.length>0){
								hadoopsList.forEach(item => {
									temp = item
									cancelAccountIds.forEach(ID => {
										if (item.id == ID) {
											temp._checked = true
											select_hadoopsList.push(temp)
										}
									})
									that.hadoopsList.push(temp)
								})
							}
							that.select_hadoop(select_hadoopsList)

							var select_hftpsList = []
							if(hftpsList != undefined && hftpsList != null && hftpsList.length>0){
								hftpsList.forEach(item => {
									temp = item
									cancelAccountIds.forEach(ID => {
										if (item.id == ID) {
											temp._checked = true
											select_hftpsList.push(temp)
										}
									})
									that.hftpsList.push(temp)
								})
							}
							that.select_uap(select_hftpsList)

							var select_paasList = []
							if(paasList != undefined && paasList != null && paasList.length>0){
								paasList.forEach(item => {
									temp = item
									cancelAccountIds.forEach(ID => {
										if (item.id == ID) {
											temp._checked = true
											select_paasList.push(temp)
										}
									})
									that.paasList.push(temp)
								})
							}
							that.select_paas(select_paasList)

							var select_dacpList = []
							if(dacpList != undefined && dacpList != null && dacpList.length>0){
								dacpList.forEach(item => {
									temp = item
									cancelAccountIds.forEach(ID => {
										if (item.id == ID) {
											temp._checked = true
											select_dacpList.push(temp)
										}
									})
									that.dacpList.push(temp)
								})
							}
							that.select_dacp(select_dacpList)

							var select_elseAuthesList = []
							if(elseAuthesList != undefined && elseAuthesList != null && elseAuthesList.length>0){
								elseAuthesList.forEach(item => {
									temp = item
									cancelAccountIds.forEach(ID => {
										if (item.id == ID) {
											temp._checked = true
											select_elseAuthesList.push(temp)
										}
									})
									that.elseAuthesList.push(temp)
								})
							}
							that.select_elseauthe(select_elseAuthesList)
						}
					})
				}
			},


			getDrafts() {
				var url = this.CONFIG.base_url_test + "/draft/content/" + this.draftsId
				var that = this;
				ajax.get({
					url: url,
					that: that,
					params: null,
					success: function(data) {
						console.log('drafts-', data.req.object)
						console.log('data:', data)
						that.applyinfo = data.req.object
						that.getUserInfo()
						that.checkRole(data.req.object.roleId)
						that.applyinfo.startTime = that.formatDate(data.req.object.startTime)
						that.applyinfo.deadline = that.formatDate(data.req.object.deadline)
						that.setdrafts({
							label: data.req.object.projectName,
							value: data.req.object.projectId
						}, data.req.object.cancelAccountIds)
					}
				})
			},
			setPeopleAccount(accounts){
				this.people[0].severs = accounts.severs;
				this.people[0].dbs = accounts.dbs;
				this.people[0].hadoops = accounts.hadoops;
				this.people[0].hftps = accounts.hftps;
				this.people[0].paas = accounts.paas;
				this.people[0].dacps = accounts.dacps;
				this.people[0].elseAuthes = accounts.elseAuthes;
			},
			getCancelAccountIds(people) {
				console.log('people', people)
				var result = []
				if (people[0].severs != undefined && people[0].severs.length > 0) {
					people[0].severs.forEach(item => {
						result.push(item.id)
					})
				}
				if (people[0].dbs != undefined && people[0].dbs.length > 0) {
					people[0].dbs.forEach(item => {
						result.push(item.id)
					})
				}
				if (people[0].hadoops != undefined && people[0].hadoops.length > 0) {
					people[0].hadoops.forEach(item => {
						result.push(item.id)
					})
				}
				if (people[0].hftps != undefined && people[0].hftps.length > 0) {
					people[0].hftps.forEach(item => {
						result.push(item.id)
					})
				}
				if (people[0].paas != undefined && people[0].paas.length > 0) {
					people[0].paas.forEach(item => {
						result.push(item.id)
					})
				}
				if (people[0].dacps != undefined && people[0].dacps.length > 0) {
					people[0].dacps.forEach(item => {
						result.push(item.id)
					})
				}
				if (people[0].elseAuthes != undefined && people[0].elseAuthes.length > 0) {
					people[0].elseAuthes.forEach(item => {
						result.push(item.id)
					})
				}

				console.log('getCancelAccountIds', result)
				return result
			},

			getInfo() {
				console.log("aaaaaaaa-------->", this.ifedit, this.isEdit == 1)
				var t = JSON.stringify(this.applyinfo)
				var temp1 = JSON.parse(t)
				//console.log("--temp1----",temp1);
				var getCancelAccountIds = this.getCancelAccountIds(this.people)
				var temp = {
					base: {},
					object: {}
				}
				temp.base.dptName = this.base.department
				temp.object = temp1
				temp.object.startTime = new Date(temp1.startTime).getTime() / 1000
				temp.object.deadline = new Date(temp1.deadline).getTime() / 1000
				var publicInfo = this.utils.setPublicInfoInfo(this.applyinfo.reqDes, temp.object.startTime, 0, "")
				temp.puslicInfo = publicInfo
				console.log('this.editcancelAccountIds', this.editcancelAccountIds)
				temp.object.cancelAccountIds = getCancelAccountIds
				temp.files = temp1.files
				//temp.files = this.$refs.file.getFiles()
				console.log('getInfo', temp)
				return temp
			},

			formatDate(value) {
				var date = new Date(value * 1000);
				var year = date.getFullYear();
				var month = this.padDate(date.getMonth() + 1);
				var day = this.padDate(date.getDate());
				return year + '-' + month + '-' + day;
			},
			padDate(value) {
				return value < 10 ? '0' + value : value;
			},

			validate() {
				console.log("----applyinfo.files-----",this.applyinfo.files.length);
				var isSubmit = false
				this.$refs["baseinfo"].validate((valid) => {
					if (valid) {
						isSubmit = true
					} else {
						this.$Message.error('请填写必填项');
					}
				})
				if(isSubmit){
					if (this.getCancelAccountIds(this.people).length == 0 && this.applyinfo.files.length<1) {
						// this.$Message.error({
						// 	content: '请选择至少一个系统的账号!',
						// 	duration: 3
						// });
		                this.$Notice.error({
		                    title: '提交失败',
		                    desc: '请至少选择一个系统账号，或填写销户模板上传附件销户系统外账号!',
		                    duration: 6
		                });
						isSubmit = false
					}
				}
				return isSubmit
			},
			// 获取处理时需要提交的参数
			getHandleParams(handleInfo) {
				console.log("-----people1111-----",this.people[0]);
				handleInfo.reqSubject = this.applyinfo.reqDes
				handleInfo.startTime = new Date(this.applyinfo.startTime).getTime() / 1000
				handleInfo.hopeTime = 0
				handleInfo.reqDes = ""
				handleInfo.isEdit = this.isEdit;
				console.log("aaaaaaaa-------->", this.ifedit, this.isEdit == 1)
				handleInfo.isChangeContent = 0;
				if (!this.ifedit) {
					handleInfo.isChangeContent = 1;
				}
				if (this.isEdit == 1) {
					console.log("this.applyinfo",this.applyinfo);
					if(this.ifedit){
						if(this.applyinfo.rspInfo != undefined && this.applyinfo.rspInfo != null){
							if(this.applyinfo.rspInfo.cancelAccounts != undefined && this.applyinfo.rspInfo.cancelAccounts != null){
								this.setPeopleAccount(this.applyinfo.rspInfo.cancelAccounts);
							}
						}
					}

					handleInfo.projectId = this.applyinfo.projectId;
					handleInfo.isChangeContent = 1;
					handleInfo.content = this.getInfo()
				}
			},
			//处理页面获取下一步处理人需要的参数
			getHandleUserParams(opOptions) {
				var param = {}
				if (opOptions != '') {
					param.vari = opOptions
				}
				param.projectId = this.applyinfo.projectId;
				return param
			},

			getUapDes(row){
				var str = "";

				if(row.isCluster){
					str = str + "采集交换集群与租户集群数据流转、"
				}

				if(row.isPerson){
					str = str + "采集交换集群与租户个人FTP数据流转、"
				}

				if(row.isPro){
					str = str + "采集交换集群与生产集群（如Hadoop三期二生产集群）数据流转、"
				}

                str = str.slice(0,str.length-1);
                return str;
			}
		},
		props: {
			isEdit: {},
			ifedit: {
				type: Boolean,
				default: false,
			},
			reqId: {
				default: null
			},
			draftsId: {
				default: null
			},
			filesList: {},
			processInfo: {},
			ishidden: {
				type: Boolean,
				default: false,
			},
		},
		// computed:{
		//     isEdit(){
		//         return this.$store.state.tabs != undefined && this.$store.state.tabs!=null? this.$store.state.tabs.isEdit:""
		//     }
		// },
		watch: {
			ifedit(newVal, oldVal) {
				//console.log('newVal',newVal)
				if (!newVal) {
					//this.checkProject(this.editproject)
					console.log("-----this.editproject--------",this.editproject,this.editcancelAccounts);
					this.setblack(this.editproject, this.editcancelAccounts)
				}
			}
		}


	}
</script>
